import request from '@/utils/request'

// 查询互助组备案信息列表
export function listGroup(query) {
  return request({
    url: '/bt/group/list',
    method: 'get',
    params: query
  })
}

// 查询互助组备案信息详细
export function getGroup(id) {
  return request({
    url: '/bt/group/' + id,
    method: 'get'
  })
}

// 新增互助组备案信息
export function addGroup(data) {
  return request({
    url: '/bt/group',
    method: 'post',
    data: data
  })
}

// 修改互助组备案信息
export function updateGroup(data) {
  return request({
    url: '/bt/group',
    method: 'put',
    data: data
  })
}

// 删除互助组备案信息
export function delGroup(id) {
  return request({
    url: '/bt/group/' + id,
    method: 'delete'
  })
}

// 导出互助组备案信息
export function exportGroup(query) {
  return request({
    url: '/bt/group/export',
    method: 'get',
    params: query
  })
}

// 申报互助组备案信息
export function declGroup(id) {
  return request({
    url: '/bt/group/decl/' + id,
    method: 'post',
  })
}

export function auditGroup(id) {
  return request({
    url: '/bt/group/audit/' + id,
    method: 'post',
  })
}


//互助组批量同步
export function hzzBatchSync() {
  return request({
    url: '/bt/group/syncData',
    method: 'get'
  })
}

//互助组批量同步二级市场
export function hzzBatchSyncToApp(ids) {
  return request({
    url: '/bt/group/syncToApp/' + ids,
    method: 'post'
  })
}

// 互助组备案-变更申报
export function updateGroupDecl(params) {
  return request({
    url: '/bt/group/modifyDecl',
    method: 'post',
    data: params
  })
}
